const EventEmitter = require('events');
const myEmitter = new EventEmitter.EventEmitter();
myEmitter.on('seen',()=>{
    console.log('有人来了');
});
myEmitter.emit('seen');

for(let i=0;i<10;i++){
    myEmitter.emit('seen');
}

console.log('-----------------------');
let event = new EventEmitter.EventEmitter();
event.on('seen',function(who){
    console.log('来了一位',who);
});
event.on('seen',function(){
    console.log('欢迎光临')
});
event.emit('seen','女士');

console.log('--------------------------');

console.log(__dirname);
console.log(__filename);

console.log('----------------------')
